package cn.wawi.dao.sys;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import cn.wawi.common.annotation.MybatisRepository;
import cn.wawi.dao.BaseDao;
import cn.wawi.entity.sys.User;

@MybatisRepository
public interface UserDao<T extends User> extends BaseDao<T> {

	/**
	 * 用户密码修改
	 * @param id 用户id
	 * @param password 原始密码
	 * @param newPassword 新密码
	 * @return
	 */
	@Update("update sys_user set password=#{newPassword} where id=#{userId} and password=#{password}")
	int updatePassword(@Param("userId")int userId, @Param("password")String password,@Param("newPassword") String newPassword);
}

